package com.tengju.settlement.infrastructure.persistence.redis.dataobject;


import com.tengju.settlement.domain.shared.ValueObject;

public class RedisKeyObject implements ValueObject<RedisKeyObject> {

    private static final long serialVersionUID = 6940813260197305885L;

    private final String value;

    public RedisKeyObject(RedisKeyPrefix prefix, String value) {
        this.value = "settlement_" + prefix.name() + "_" + value;
    }

    public String getValue() {
        return value;
    }

    @Override
    public boolean sameValueAs(RedisKeyObject other) {
        return other != null && this.value.equals(other.value);
    }

}
